package com.linkallcloud.core.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.linkallcloud.core.activity.IFlowStepActivity;
import com.linkallcloud.core.domain.FlowStep;
import com.linkallcloud.core.dto.Trace;

public abstract class FlowStepService<T extends FlowStep, A extends IFlowStepActivity<T>> extends BaseService<T, A>
        implements IFlowStepService<T> {

    @Override
    public List<T> findByObj(Trace t, Integer flowType, Long objId, String objUuid, String objType,
            String objPropType) {
        return activity().findByObj(t, flowType, objId, objUuid, objType, objPropType);
    }

    @Override
    public List<T> findByTwf(Trace t, Long twfInstId, String twfInstUuid) {
        return activity().findByTwf(t, twfInstId, twfInstUuid);
    }

    @Transactional(readOnly = false)
    @Override
    public boolean flow(Trace t, T flow) {
        return activity().flow(t, flow);
    }

    @Transactional(readOnly = false)
    @Override
    public void progress(Trace t, Long twfInstId, String twfInstUuid, int progress) {
        activity().progress(t, twfInstId, twfInstUuid, progress);
    }

    @Transactional(readOnly = false)
    @Override
    public void complete(Trace t, Long twfInstId, String twfInstUuid, int op) {
        activity().complete(t, twfInstId, twfInstUuid, op);
    }

}
